package engine.light;

import engine.shader.Shader;

public abstract class Light {

	private float[] diffuse;
	private float[] specular;
	
	private boolean enable = true;
	
	public Light() {
		diffuse = new float[]{0, 0, 0, 1};
		specular = new float[]{0, 0, 0, 1};
	}
	
	public float[] getDiffuse() {
		return diffuse;
	}
	
	public void setDiffuse(float r, float g, float b) {
		diffuse[0] = r;
		diffuse[1] = g;
		diffuse[2] = b;
	}

	public float[] getSpecular() {
		return specular;
	}

	public void setSpecular(float r, float g, float b) {
		specular[0] = r;
		specular[1] = g;
		specular[2] = b;
	}
	
	public void apply(Shader shader, int lightSource) {
		shader.sendUniform4f("lights[" + lightSource + "].diffuse", diffuse);
		shader.sendUniform4f("lights[" + lightSource + "].specular", specular);
	}

	public boolean isEnable() {
		return enable;
	}

	public void setEnable(boolean enable) {
		this.enable = enable;
	}
}
